Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#5077] feat(core): Add the check of user before creating metadata object #5096

Merged
merged 2 commits into from
Oct 14, 2024

Conversation

jerqi
Copy link
Contributor

@jerqi jerqi commented Oct 11, 2024

What changes were proposed in this pull request?

Add the check of user before creating metadata object.

Why are the changes needed?

Fix: #5077

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Added UT.

@jerqi jerqi marked this pull request as draft October 11, 2024 02:21
@jerqi jerqi changed the title [#5070] feat(core): Add the check of user before creating metadata object [#5077] feat(core): Add the check of user before creating metadata object Oct 11, 2024
@jerqi jerqi marked this pull request as ready for review October 11, 2024 03:10
@jerqi jerqi self-assigned this Oct 11, 2024
Comment on lines +80 to +85
containerSuite.startKafkaContainer();
kafkaBootstrapServers =
String.format(
"%s:%d",
containerSuite.getKafkaContainer().getContainerIpAddress(),
KafkaContainer.DEFAULT_BROKER_PORT);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to use a Kafka container to test?
If we can use Hive container to test at the same time, we can save resources.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to test the creating topic case.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, This UT only have throw ForbiddenException UT.
I think we need to add normal operation UT.

Copy link
Contributor Author

@jerqi jerqi Oct 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other UTs, we have created the metadata objects. It's ok to add it.

@@ -71,6 +72,10 @@ public Catalog createCatalog(
String comment,
Map<String, String> properties)
throws NoSuchMetalakeException, CatalogAlreadyExistsException {
// Check whether the current user exists or not
AuthorizationUtils.checkCurrentUser(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we only need to check createXXX operation?

Copy link
Contributor Author

@jerqi jerqi Oct 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should check every operation actually.
We don't support meta authentication now. I think this should be included to meta authentication.
But for some managers, we don't a dispatcher interface for them like ownerManager and TagManager. We will add the interfaces first. I'm not sure to do them now. So I just make a minor improvement to check createXXX operation first.

@jerryshao jerryshao merged commit 6aefe3b into apache:main Oct 14, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Improvement] Add the check whether user is added to the metalake
3 participants